//
//  HykStatusBottomView.swift
//  sinaWeiBo
//
//  Created by hyk on 15/12/5.
//  Copyright © 2015年 hyk. All rights reserved.
//

import UIKit

class HykStatusBottomView: UIView {
     //构造方法
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }

    //准备UI
    private func prepareUI(){
      //添加子控件
        addSubview(forwardButton)
        addSubview(sImageViewFirst)
        addSubview(commentButton)
        addSubview(sImageViewSecond)
        addSubview(likeButton)

      //添加约束
        //三个按钮平铺
        /// 平铺子控件
        /// self: 父控件
        /// views: 哪些子控件要平铺
        /// insets边距
        self.ff_HorizontalTile([forwardButton,commentButton,likeButton], insets: UIEdgeInsetsZero)
        
        sImageViewFirst.ff_AlignVertical(type: ff_AlignType.CenterRight, referView: forwardButton, size: nil )
        sImageViewSecond.ff_AlignVertical(type: ff_AlignType.CenterRight, referView: commentButton, size: nil )
    
    }
    //MARK: - 懒加载
    //转发按钮
    private lazy var forwardButton:UIButton = {
      let button = UIButton()
     //按钮的图片
      button.setImage(UIImage(named: "timeline_icon_retweet"), forState: UIControlState.Normal)
        
     //按钮的文字
     button.setTitle("转发", forState: UIControlState.Normal)
        
     //按钮的颜色
     button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
     
     //文字的大小
     button.titleLabel?.font = UIFont.systemFontOfSize(12)
    
      return button
    }()
    
    //评论按钮
    private lazy var commentButton:UIButton = {
     let button = UIButton()

        //按钮的图片
        button.setImage(UIImage(named: "timeline_icon_comment"), forState: UIControlState.Normal)
        
        //按钮的文字
        button.setTitle("评论", forState: UIControlState.Normal)
        
        //按钮的颜色
        button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        
        //文字的大小

        button.titleLabel?.font = UIFont.systemFontOfSize(12)
        return button
    }()
    
    //赞按钮
    private lazy var likeButton:UIButton = {
    
        let button = UIButton()
        
        //按钮的图片
        button.setImage(UIImage(named: "timeline_icon_unlike"), forState: UIControlState.Normal)
        
        //按钮的文字
        button.setTitle("赞", forState: UIControlState.Normal)
        
        //按钮的颜色
        button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        
        //文字的大小
        
        button.titleLabel?.font = UIFont.systemFontOfSize(12)
        
        return button

    }()
    
    //第一条分割线
    private lazy var sImageViewFirst:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
    //第二条分割线
    private lazy var sImageViewSecond:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
}
